﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterAdmin.master" AutoEventWireup="true" CodeBehind="Add_And_Edit_Goods.aspx.cs" Inherits="Project_Udrinkwater.PagesAdmin.Add_And_Edit_Goods" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
     <style type="text/css">
        #mainContainer td.buttonCell {
            padding-top: 15px;
        } 
        #mainContainer td.caption {
            padding-right: 5px; 
            padding-top: 4px; 
            vertical-align: top;
        } 
        #mainContainer td.content {
            padding-bottom: 20px;
        }
        #mainContainer td.imagePreviewCell {
            border: solid 2px gray; 
            width: 110px;
            height: 115px;
            /*if IE*/ 
            height:expression("110px");
            text-align: center;
        }
        #mainContainer td.note {
            text-align: left;
            padding-top: 1px;
        }
    </style>
    <script type="text/javascript">
    // <![CDATA[
        var aspxPreviewImgSrc = getPreviewImageElement().src;
    // ]]> 
    </script>
     <script type="text/javascript">
    // <![CDATA[
         function Uploader_OnUploadStart() {
             btnUpload.SetEnabled(false);
         }
         function Uploader_OnFileUploadComplete(args) {
             var imgSrc = aspxPreviewImgSrc;
             if (args.isValid) {
                 var date = new Date();
                 imgSrc = "UploadImages/" + args.callbackData + "?dx=" + date.getTime();
             }
             getPreviewImageElement().src = imgSrc;
         }
         function Uploader_OnFilesUploadComplete(args) {
             UpdateUploadButton();
         }
         function UpdateUploadButton() {
             btnUpload.SetEnabled(uploader.GetText(0) != "");
         }
         function getPreviewImageElement() {
             return document.getElementById("previewImage");
         }
    // ]]> 
    </script>
    <dx:ASPxRoundPanel ID="RPN_AddGoods" runat="server" Width="100%" 
         HeaderText="เพิ่ม แก้ไข รายการสินค้า">
        <HeaderStyle Font-Size="Medium" HorizontalAlign="Left" />
        <PanelCollection>
<dx:PanelContent runat="server" SupportsDisabledAttribute="True">
     <div align="center">
           <asp:Panel ID="Pn_Insert" runat="server" Visible="False">
           <fieldset>
               <legend>เพิ่มรายการสินค้า</legend>
                <table>
                    <tr>
                        <td align="right">
                            &nbsp;</td>
                        <td class="imagePreviewCell" style="width: 313px">
                            &nbsp;&nbsp;
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td align="right">
                            เลือกรูปภาพ :</td>
                        <td style="width: 313px">
                            <asp:FileUpload ID="FileUpload1" runat="server" />
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
            <tr>
                <td align="right">
                    รหัสสินค้า:</td>
                <td style="width: 313px">
                    <dx:ASPxTextBox ID="tb_GoodsIDInsert" runat="server" ReadOnly="True" 
                        Width="170px">
                    </dx:ASPxTextBox>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
                    <tr>
                        <td align="right">
                            ชื่อสินค้า :</td>
                        <td style="width: 313px">
                            <dx:ASPxTextBox ID="tb_GoodsName" runat="server" Width="170px">
                            </dx:ASPxTextBox>
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
            <tr>
                <td align="right">
                    ราคาขายส่ง :</td>
                <td style="width: 313px">
    <dx:ASPxTextBox ID="tb_Price" runat="server" Width="170px">
    </dx:ASPxTextBox>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
                    <tr>
                        <td align="right">
                            ราคาขายปลีก :
                        </td>
                        <td style="width: 313px">
                            <dx:ASPxTextBox ID="tb_PriceRetial" runat="server" Width="170px">
                            </dx:ASPxTextBox>
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td align="right">
                            หน่วยสินค้า :</td>
                        <td style="width: 313px">
                            <dx:ASPxComboBox ID="cb_UnitInsert" runat="server" SelectedIndex="0">
                                <Items>
                                    <dx:ListEditItem Selected="True" Text="ถัง" Value="1" />
                                    <dx:ListEditItem Text="ลัง" Value="2" />
                                    <dx:ListEditItem Text="แพ็ค" Value="3" />
                                    <dx:ListEditItem Text="โหล" Value="4" />
                                </Items>
                            </dx:ASPxComboBox>
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td align="right">
                            <dx:ASPxLabel ID="lb_loanprice" runat="server" Font-Size="Small" 
                                Text="ราคายืม :">
                            </dx:ASPxLabel>
                        </td>
                        <td style="width: 313px">
                            <dx:ASPxTextBox ID="tb_LoanPrice" runat="server" Width="170px">
                            </dx:ASPxTextBox>
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
            <tr>
                <td>
                    &nbsp;</td>
                <td style="width: 313px">
                    <table style="width: 64%">
                        <tr>
                            <td style="width: 101px">
    <dx:ASPxButton ID="bt_InsertPrice" runat="server" onclick="ASPxButton1_Click" 
        Text="เพิ่มสินค้า" Theme="Office2003Blue">
    </dx:ASPxButton>
                            </td>
                            <td>
                                <dx:ASPxButton ID="bt_Cancle" runat="server" Text="ยกเลิก" 
                                    onclick="bt_Cancle_Click" Theme="Office2003Blue">
                                </dx:ASPxButton>
                            </td>
                        </tr>
                    </table>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
        </table>
           </fieldset>
        </asp:Panel>
         <asp:Panel ID="Pn_Update" runat="server" Visible="False">
                <fieldset>
               <legend>แก้ไขรายการสินค้า</legend>
                <table>
            <tr>
                <td align="right">
                    &nbsp;</td>
                <td style="width: 313px">
                    <asp:Image ID="Image1" runat="server" Height="120px" Width="100px" />
                </td>
                <td>
                    &nbsp;</td>
            </tr>
                    <tr>
                        <td align="right">
                            เลือกรูปภาพ :</td>
                        <td style="width: 313px">
                            <asp:FileUpload ID="FileUpload2" runat="server" />
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
            <tr>
                <td align="right" style="height: 25px">
                    รหัสสินค้า :</td>
                <td style="width: 313px; height: 25px;">
                    <dx:ASPxTextBox ID="tb_GoodsIDUpdate" runat="server" Width="170px" 
                        ReadOnly="True">
                    </dx:ASPxTextBox>
                </td>
                <td style="height: 25px">
                    </td>
            </tr>
                    <tr>
                        <td align="right">
                            ชื่อสินค้า :</td>
                        <td style="width: 313px">
                            <dx:ASPxTextBox ID="tb_GoodsNameUpdate" runat="server" Width="170px">
                            </dx:ASPxTextBox>
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
            <tr>
                <td align="right">
                    ราคาขายส่ง :</td>
                <td style="width: 313px">
                    <dx:ASPxTextBox ID="tb_PriceUpdate" runat="server" Width="170px">
                    </dx:ASPxTextBox>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
                    <tr>
                        <td align="right">
                            ราคาขายปลีก :</td>
                        <td style="width: 313px">
                            <dx:ASPxTextBox ID="tb_PriceUpdateDetial" runat="server" Width="170px">
                            </dx:ASPxTextBox>
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td align="right">
                            หน่วยสินค้า :</td>
                        <td style="width: 313px">
                            <dx:ASPxComboBox ID="cb_UnitUpdate" runat="server" SelectedIndex="0">
                                <Items>
                                    <dx:ListEditItem Selected="True" Text="ถัง" Value="1" />
                                    <dx:ListEditItem Text="ลัง" Value="2" />
                                    <dx:ListEditItem Text="แพ็ค" Value="3" />
                                    <dx:ListEditItem Text="โหล" Value="4" />
                                </Items>
                            </dx:ASPxComboBox>
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td align="right">
                            <dx:ASPxLabel ID="lb_loanprice0" runat="server" Font-Size="Small" 
                                Text="ราคายืม :">
                            </dx:ASPxLabel>
                        </td>
                        <td style="width: 313px">
                            <dx:ASPxTextBox ID="tb_LoanPriceUpdate" runat="server" Width="170px">
                            </dx:ASPxTextBox>
                        </td>
                        <td>
                            &nbsp;</td>
                    </tr>
            <tr>
                <td>
                    &nbsp;</td>
                <td style="width: 313px">
                    <table style="width: 64%">
                        <tr>
                            <td style="width: 101px">
    <dx:ASPxButton ID="bt_Update" runat="server" onclick="bt_Update_Click" 
        Text="ตกลง" Theme="Office2003Blue">
    </dx:ASPxButton>
                            </td>
                            <td>
                                <dx:ASPxButton ID="bt_CancleUpdate" runat="server" Text="ยกเลิก" 
                                    onclick="bt_CancleUpdate_Click" Theme="Office2003Blue">
                                </dx:ASPxButton>
                            </td>
                        </tr>
                    </table>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
        </table>
           </fieldset>
        </asp:Panel>
    </div>
</dx:PanelContent>
</PanelCollection>
    </dx:ASPxRoundPanel>
</asp:Content>
